SetCtlValue
SetCtlValue
Set a control's value; check/uncheck boxes, etc. short theValue ; desired new value for the control
SetCtlValue updates the current value of a control. It is used to draw/erase Xs in check boxes and dots in radio buttons and it causes the thumb of a scroll
bar (or other indicator) to be re positioned.
theControl is a handle leading to a variable-length ControlRecord structure. It specifies which control to update.
theValue specifies the desired new value. For check boxes and radio buttons,
use 1 to indicate "selected" and 0 to indicate "deselected". Values that
are either too low or too high are pinned to the control's minimum or
maximum settings, respectively.
Notes: SetCtlValue must be called to reflect the user's choices in check boxes and radio buttons-the X's and •'s ARE NOT drawn or erased automatically.
For instance, it is up to the application to use SetCtlValue to erase all radio-button dots (•'s) except for the new choice.
When the user drags the thumb of a scroll bar, its contrlValue is
automatically updated to correspond to the thumb's new position. On other
document motions (such as when the user presses the "page down" key), you
must use this function to reposition the indicator (thumb).
Note that an out-of-range value for theValue is coerced to the maximum or
minimum to make it valid. The result is stored into the contrlValue field of